<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>二维码</title>
    <script src="js/vue.min.js"></script>
    <script src="js/barcode.all.min.js"></script>
    <style>
        @page {
            margin: 0px;
        }
    </style>
</head>

<body>
    <div id="barcode">
        <svg id="barcode"></svg>
    </div>
</body>
<script>
    const { ipcRenderer } = require('electron');
    new Vue({
        el: '#barcode',
        data: {
            currentOrder: {},
        },
        mounted() {
            ipcRenderer.on('ping', (e, data) => {
                this.currentOrder = data;
                JsBarcode("#barcode", this.currentOrder.id);
            })
        }
    })
</script>

</html>